home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 85 / CD Actual 85 Febrero 2004.iso / Experto / Apache / apache_2.0.48-win32-x86-no_ssl.msi / Data.Cab / F252910_ssl_intro.html.en < prev    next >
Encoding:
Extensible Markup Language  |  2003-06-30  |  33.2 KB  |  639 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
  4.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5.               This file is generated from xml source: DO NOT EDIT
  6.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7.       -->
  8. <title>SSL/TLS Strong Encryption: An Introduction - Apache HTTP Server</title>
  9. <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
  10. <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
  11. <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
  12. <link href="../images/favicon.ico" rel="shortcut icon" /></head>
  13. <body id="manual-page"><div id="page-header">
  14. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
  15. <p class="apache">Apache HTTP Server Version 2.0</p>
  16. <img alt="" src="../images/feather.gif" /></div>
  17. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  18. <div id="path">
  19. <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">SSL/TLS</a></div><div id="page-content"><div id="preamble"><h1>SSL/TLS Strong Encryption: An Introduction</h1>
  20. <div class="toplang">
  21. <p><span>Available Languages: </span><a href="../en/ssl/ssl_intro.html" title="English"> en </a></p>
  22. </div>
  23.  
  24. <blockquote>
  25. <p>The nice thing about standards is that there are so many to choose
  26. from. And if you really don't like all the standards you just have to
  27. wait another year until the one arises you are looking for.</p>
  28.  
  29. <p class="cite">-- <cite>A. Tanenbaum</cite>, "Introduction to
  30. Computer Networks"</p>
  31. </blockquote>
  32.  
  33. <p>As an introduction this chapter is aimed at readers who are familiar
  34. with the Web, HTTP, and Apache, but are not security experts. It is not
  35. intended to be a definitive guide to the SSL protocol, nor does it discuss
  36. specific techniques for managing certificates in an organization, or the
  37. important legal issues of patents and import and export restrictions.
  38. Rather, it is intended to provide a common background to mod_ssl users by
  39. pulling together various concepts, definitions, and examples as a starting
  40. point for further exploration.</p>
  41.  
  42. <p>The presented content is mainly derived, with permission by the author,
  43. from the article <a href="http://home.earthlink.net/~fjhirsch/Papers/wwwj/article.html">Introducing
  44. SSL and Certificates using SSLeay</a> from <a href="http://home.earthlink.net/~fjhirsch/">Frederick J. Hirsch</a>, of The
  45. Open Group Research Institute, which was published in <a href="http://www.ora.com/catalog/wjsum97/">Web Security: A Matter of
  46. Trust</a>, World Wide Web Journal, Volume 2, Issue 3, Summer 1997.
  47. Please send any positive feedback to <a href="mailto:hirsch@fjhirsch.com">Frederick Hirsch</a> (the original
  48. article author) and all negative feedback to <a href="mailto:rse@engelschall.com">Ralf S. Engelschall</a> (the
  49. <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code> author).</p>
  50. </div>
  51. <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#cryptographictech">Cryptographic Techniques</a></li>
  52. <li><img alt="" src="../images/down.gif" /> <a href="#certificates">Certificates</a></li>
  53. <li><img alt="" src="../images/down.gif" /> <a href="#ssl">Secure Sockets Layer (SSL)</a></li>
  54. <li><img alt="" src="../images/down.gif" /> <a href="#references">References</a></li>
  55. </ul></div>
  56. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  57. <div class="section">
  58. <h2><a name="cryptographictech" id="cryptographictech">Cryptographic Techniques</a></h2>
  59.  
  60. <p>Understanding SSL requires an understanding of cryptographic
  61. algorithms, message digest functions (aka. one-way or hash functions), and
  62. digital signatures. These techniques are the subject of entire books (see
  63. for instance [<a href="#AC96">AC96</a>]) and provide the basis for privacy,
  64. integrity, and authentication.</p>
  65.  
  66. <h3><a name="cryptographicalgo" id="cryptographicalgo">Cryptographic Algorithms</a></h3>
  67.  
  68.     <p>Suppose Alice wants to send a message to her bank to transfer some
  69.     money. Alice would like the message to be private, since it will
  70.     include information such as her account number and transfer amount. One
  71.     solution is to use a cryptographic algorithm, a technique that would
  72.     transform her message into an encrypted form, unreadable except by
  73.     those it is intended for. Once in this form, the message may only be
  74.     interpreted through the use of a secret key. Without the key the
  75.     message is useless: good cryptographic algorithms make it so difficult
  76.     for intruders to decode the original text that it isn't worth their
  77.     effort.</p>
  78.  
  79.     <p>There are two categories of cryptographic algorithms: conventional
  80.     and public key.</p>
  81.  
  82.     <dl>
  83.     <dt>Conventional cryptography</dt>
  84.     <dd>also known as symmetric cryptography, requires the sender and
  85.     receiver to share a key: a secret piece of information that may be
  86.     used to encrypt or decrypt a message. If this key is secret, then
  87.     nobody other than the sender or receiver may read the message. If
  88.     Alice and the bank know a secret key, then they may send each other
  89.     private messages. The task of privately choosing a key before
  90.     communicating, however, can be problematic.</dd>
  91.  
  92.     <dt>Public key cryptography</dt>
  93.     <dd>also known as asymmetric cryptography, solves the key exchange
  94.     problem by defining an algorithm which uses two keys, each of which
  95.     may be used to encrypt a message. If one key is used to encrypt a
  96.     message then the other must be used to decrypt it. This makes it
  97.     possible to receive secure messages by simply publishing one key
  98.     (the public key) and keeping the other secret (the private key).</dd>
  99.     </dl>
  100.  
  101.     <p>Anyone may encrypt a message using the public key, but only the
  102.     owner of the private key will be able to read it. In this way, Alice
  103.     may send private messages to the owner of a key-pair (the bank), by
  104.     encrypting it using their public key. Only the bank will be able to
  105.     decrypt it.</p>
  106.  
  107.  
  108. <h3><a name="messagedigests" id="messagedigests">Message Digests</a></h3>
  109.  
  110.     <p>Although Alice may encrypt her message to make it private, there
  111.     is still a concern that someone might modify her original message or
  112.     substitute it with a different one, in order to transfer the money
  113.     to themselves, for instance. One way of guaranteeing the integrity
  114.     of Alice's message is to create a concise summary of her message and
  115.     send this to the bank as well. Upon receipt of the message, the bank
  116.     creates its own summary and compares it with the one Alice sent. If
  117.     they agree then the message was received intact.</p>
  118.  
  119.     <p>A summary such as this is called a <dfn>message digest</dfn>, <em>one-way
  120. function</em> or <em>hash function</em>. Message digests are used to create
  121. short, fixed-length representations of longer, variable-length messages.
  122. Digest algorithms are designed to produce unique digests for different
  123. messages. Message digests are designed to make it too difficult to determine
  124. the message from the digest, and also impossible to find two different
  125. messages which create the same digest -- thus eliminating the possibility of
  126. substituting one message for another while maintaining the same digest.</p>
  127. <p>Another challenge that Alice faces is finding a way to send the digest to the
  128. bank securely; when this is achieved, the integrity of the associated message
  129. is assured. One way to do this is to include the digest in a digital
  130. signature.</p>
  131.  
  132.  
  133. <h3><a name="digitalsignatures" id="digitalsignatures">Digital Signatures</a></h3>
  134. <p>When Alice sends a message to the bank, the bank needs to ensure that the
  135. message is really from her, so an intruder does not request a transaction
  136. involving her account. A <em>digital signature</em>, created by Alice and
  137. included with the message, serves this purpose.</p>
  138.  
  139. <p>Digital signatures are created by encrypting a digest of the message,
  140. and other information (such as a sequence number) with the sender's
  141. private key. Though anyone may <em>decrypt</em> the signature using the public
  142. key, only the signer knows the private key. This means that only they may
  143. have signed it. Including the digest in the signature means the signature is
  144. only good for that message; it also ensures the integrity of the message since
  145. no one can change the digest and still sign it.</p>
  146. <p>To guard against interception and reuse of the signature by an intruder at a
  147. later date, the signature contains a unique sequence number. This protects
  148. the bank from a fraudulent claim from Alice that she did not send the message
  149. -- only she could have signed it (non-repudiation).</p>
  150.  
  151. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  152. <div class="section">
  153. <h2><a name="certificates" id="certificates">Certificates</a></h2>
  154.  
  155. <p>Although Alice could have sent a private message to the bank, signed
  156. it, and ensured the integrity of the message, she still needs to be sure
  157. that she is really communicating with the bank. This means that she needs
  158. to be sure that the public key she is using corresponds to the bank's
  159. private key. Similarly, the bank also needs to verify that the message
  160. signature really corresponds to Alice's signature.</p>
  161.  
  162. <p>If each party has a certificate which validates the other's identity,
  163. confirms the public key, and is signed by a trusted agency, then they both
  164. will be assured that they are communicating with whom they think they are.
  165. Such a trusted agency is called a <em>Certificate Authority</em>, and
  166. certificates are used for authentication.</p>
  167.  
  168. <h3><a name="certificatecontents" id="certificatecontents">Certificate Contents</a></h3>
  169.  
  170.     <p>A certificate associates a public key with the real identity of
  171.     an individual, server, or other entity, known as the subject. As
  172.     shown in <a href="#table1">Table 1</a>, information about the subject
  173.     includes identifying information (the distinguished name), and the
  174.     public key. It also includes the identification and signature of the
  175.     Certificate Authority that issued the certificate, and the period of
  176.     time during which the certificate is valid. It may have additional
  177.     information (or extensions) as well as administrative information
  178.     for the Certificate Authority's use, such as a serial number.</p>
  179.  
  180.     <h4><a name="table1" id="table1">Table 1: Certificate Information</a></h4>
  181.     
  182.     <table>
  183.     
  184.     <tr><th>Subject</th>
  185.         <td>Distinguished Name, Public Key</td></tr>
  186.     <tr><th>Issuer</th>
  187.         <td>Distinguished Name, Signature</td></tr>
  188.     <tr><th>Period of Validity</th>
  189.         <td>Not Before Date, Not After Date</td></tr>
  190.     <tr><th>Administrative Information</th>
  191.         <td>Version, Serial Number</td></tr>
  192.     <tr><th>Extended Information</th>
  193.         <td>Basic Constraints, Netscape Flags, etc.</td></tr>
  194.     </table>
  195.     
  196.  
  197.     <p>A distinguished name is used to provide an identity in a specific
  198.     context -- for instance, an individual might have a personal
  199.     certificate as well as one for their identity as an employee.
  200.     Distinguished names are defined by the X.509 standard [<a href="#X509">X509</a>], which defines the fields, field names, and
  201.     abbreviations used to refer to the fields (see <a href="#table2">Table
  202.     2</a>).</p>
  203.  
  204.     <h4><a name="table2" id="table2">Table 2: Distinguished Name Information</a></h4>
  205.     
  206.     <table class="bordered">
  207.     
  208.     <tr><th>DN Field</th>
  209.         <th>Abbrev.</th>
  210.         <th>Description</th>
  211.         <th>Example</th></tr>
  212.     <tr><td>Common Name</td>
  213.         <td>CN</td>
  214.         <td>Name being certified</td>
  215.         <td>CN=Joe Average</td></tr>
  216.     <tr><td>Organization or Company</td>
  217.         <td>O</td>
  218.         <td>Name is associated with this<br />organization</td>
  219.         <td>O=Snake Oil, Ltd.</td></tr>
  220.     <tr><td>Organizational Unit</td>
  221.         <td>OU</td>
  222.         <td>Name is associated with this <br />organization unit, such
  223.         as a department</td>
  224.         <td>OU=Research Institute</td></tr>
  225.     <tr><td>City/Locality</td>
  226.         <td>L</td>
  227.         <td>Name is located in this City</td>
  228.         <td>L=Snake City</td></tr>
  229.     <tr><td>State/Province</td>
  230.         <td>ST</td>
  231.         <td>Name is located in this State/Province</td>
  232.         <td>ST=Desert</td></tr>
  233.     <tr><td>Country</td>
  234.         <td>C</td>
  235.         <td>Name is located in this Country (ISO code)</td>
  236.         <td>C=XZ</td></tr>
  237.     </table>
  238.     
  239.  
  240.     <p>A Certificate Authority may define a policy specifying which
  241.     distinguished field names are optional, and which are required. It
  242.     may also place requirements upon the field contents, as may users of
  243.     certificates. As an example, a Netscape browser requires that the
  244.     Common Name for a certificate representing a server has a name which
  245.     matches a wildcard pattern for the domain name of that server, such
  246.     as <code>*.snakeoil.com</code>.</p>
  247.  
  248.     <p>The binary format of a certificate is defined using the ASN.1
  249.     notation [<a href="#X208">X208</a>] [<a href="#PKCS">PKCS</a>]. This
  250.     notation defines how to specify the contents, and encoding rules
  251.     define how this information is translated into binary form. The binary
  252.     encoding of the certificate is defined using Distinguished Encoding
  253.     Rules (DER), which are based on the more general Basic Encoding Rules
  254.     (BER). For those transmissions which cannot handle binary, the binary
  255.     form may be translated into an ASCII form by using Base64 encoding
  256.     [<a href="#MIME">MIME</a>]. This encoded version is called PEM encoded
  257.     (the name comes from "Privacy Enhanced Mail"), when placed between
  258.     begin and end delimiter lines as illustrated in the following
  259.     example.</p>
  260.  
  261.     <div class="example"><h3>Example of a PEM-encoded certificate (snakeoil.crt)</h3><pre>-----BEGIN CERTIFICATE-----
  262. MIIC7jCCAlegAwIBAgIBATANBgkqhkiG9w0BAQQFADCBqTELMAkGA1UEBhMCWFkx
  263. FTATBgNVBAgTDFNuYWtlIERlc2VydDETMBEGA1UEBxMKU25ha2UgVG93bjEXMBUG
  264. A1UEChMOU25ha2UgT2lsLCBMdGQxHjAcBgNVBAsTFUNlcnRpZmljYXRlIEF1dGhv
  265. cml0eTEVMBMGA1UEAxMMU25ha2UgT2lsIENBMR4wHAYJKoZIhvcNAQkBFg9jYUBz
  266. bmFrZW9pbC5kb20wHhcNOTgxMDIxMDg1ODM2WhcNOTkxMDIxMDg1ODM2WjCBpzEL
  267. MAkGA1UEBhMCWFkxFTATBgNVBAgTDFNuYWtlIERlc2VydDETMBEGA1UEBxMKU25h
  268. a2UgVG93bjEXMBUGA1UEChMOU25ha2UgT2lsLCBMdGQxFzAVBgNVBAsTDldlYnNl
  269. cnZlciBUZWFtMRkwFwYDVQQDExB3d3cuc25ha2VvaWwuZG9tMR8wHQYJKoZIhvcN
  270. AQkBFhB3d3dAc25ha2VvaWwuZG9tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
  271. gQDH9Ge/s2zcH+da+rPTx/DPRp3xGjHZ4GG6pCmvADIEtBtKBFAcZ64n+Dy7Np8b
  272. vKR+yy5DGQiijsH1D/j8HlGE+q4TZ8OFk7BNBFazHxFbYI4OKMiCxdKzdif1yfaa
  273. lWoANFlAzlSdbxeGVHoT0K+gT5w3UxwZKv2DLbCTzLZyPwIDAQABoyYwJDAPBgNV
  274. HRMECDAGAQH/AgEAMBEGCWCGSAGG+EIBAQQEAwIAQDANBgkqhkiG9w0BAQQFAAOB
  275. gQAZUIHAL4D09oE6Lv2k56Gp38OBDuILvwLg1v1KL8mQR+KFjghCrtpqaztZqcDt
  276. 2q2QoyulCgSzHbEGmi0EsdkPfg6mp0penssIFePYNI+/8u9HT4LuKMJX15hxBam7
  277. dUHzICxBVC1lnHyYGjDuAMhe396lYAn8bCld1/L4NMGBCQ==
  278. -----END CERTIFICATE-----</pre></div>
  279.  
  280.  
  281. <h3><a name="certificateauthorities" id="certificateauthorities">Certificate Authorities</a></h3>
  282.  
  283.     <p>By first verifying the information in a certificate request
  284.     before granting the certificate, the Certificate Authority assures
  285.     the identity of the private key owner of a key-pair. For instance,
  286.     if Alice requests a personal certificate, the Certificate Authority
  287.     must first make sure that Alice really is the person the certificate
  288.     request claims.</p>
  289.  
  290.     <h4><a name="certificatechains" id="certificatechains">Certificate Chains</a></h4>
  291.     
  292.         <p>A Certificate Authority may also issue a certificate for
  293.         another Certificate Authority. When examining a certificate,
  294.         Alice may need to examine the certificate of the issuer, for each
  295.         parent Certificate Authority, until reaching one which she has
  296.         confidence in. She may decide to trust only certificates with a
  297.         limited chain of issuers, to reduce her risk of a "bad" certificate
  298.         in the chain.</p>
  299.     
  300.  
  301.     <h4><a name="rootlevelca" id="rootlevelca">Creating a Root-Level CA</a></h4>
  302.     
  303.         <p>As noted earlier, each certificate requires an issuer to assert
  304.         the validity of the identity of the certificate subject, up to
  305.         the top-level Certificate Authority (CA). This presents a problem:
  306.         Since this is who vouches for the certificate of the top-level
  307.         authority, which has no issuer? In this unique case, the
  308.         certificate is "self-signed", so the issuer of the certificate is
  309.         the same as the subject. As a result, one must exercise extra care
  310.         in trusting a self-signed certificate. The wide publication of a
  311.         public key by the root authority reduces the risk in trusting this
  312.         key -- it would be obvious if someone else publicized a key
  313.         claiming to be the authority. Browsers are preconfigured to trust
  314.         well-known certificate authorities.</p>
  315.  
  316.         <p>A number of companies, such as <a href="http://www.thawte.com/">Thawte</a> and <a href="http://www.verisign.com/">VeriSign</a>
  317.         have established themselves as Certificate Authorities. These
  318.         companies provide the following services:</p>
  319.  
  320.         <ul>
  321.         <li>Verifying certificate requests</li>
  322.         <li>Processing certificate requests</li>
  323.         <li>Issuing and managing certificates</li>
  324.         </ul>
  325.  
  326.         <p>It is also possible to create your own Certificate Authority.
  327.         Although risky in the Internet environment, it may be useful
  328.         within an Intranet where the organization can easily verify the
  329.         identities of individuals and servers.</p>
  330.     
  331.  
  332.     <h4><a name="certificatemanagement" id="certificatemanagement">Certificate Management</a></h4>
  333.     
  334.         <p>Establishing a Certificate Authority is a responsibility which
  335.         requires a solid administrative, technical, and management
  336.         framework. Certificate Authorities not only issue certificates,
  337.         they also manage them -- that is, they determine how long
  338.         certificates are valid, they renew them, and they keep lists of
  339.         certificates that have already been issued but are no longer valid
  340.         (Certificate Revocation Lists, or CRLs). Say Alice is entitled to
  341.         a certificate as an employee of a company. Say too, that the
  342.         certificate needs to be revoked when Alice leaves the company. Since
  343.         certificates are objects that get passed around, it is impossible
  344.         to tell from the certificate alone that it has been revoked. When
  345.         examining certificates for validity, therefore, it is necessary to
  346.         contact the issuing Certificate Authority to check CRLs -- this
  347.         is not usually an automated part of the process.</p>
  348.  
  349.         <div class="note"><h3>Note</h3>
  350.         <p>If you use a Certificate Authority that is not configured into
  351.         browsers by default, it is necessary to load the Certificate
  352.         Authority certificate into the browser, enabling the browser to
  353.         validate server certificates signed by that Certificate Authority.
  354.         Doing so may be dangerous, since once loaded, the browser will
  355.         accept all certificates signed by that Certificate Authority.</p>
  356.         </div>
  357.     
  358.  
  359.  
  360. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  361. <div class="section">
  362. <h2><a name="ssl" id="ssl">Secure Sockets Layer (SSL)</a></h2>
  363.  
  364. <p>The Secure Sockets Layer protocol is a protocol layer which may be
  365. placed between a reliable connection-oriented network layer protocol
  366. (e.g. TCP/IP) and the application protocol layer (e.g. HTTP). SSL provides
  367. for secure communication between client and server by allowing mutual
  368. authentication, the use of digital signatures for integrity, and encryption
  369. for privacy.</p>
  370.  
  371. <p>The protocol is designed to support a range of choices for specific
  372. algorithms used for cryptography, digests, and signatures. This allows
  373. algorithm selection for specific servers to be made based on legal, export
  374. or other concerns, and also enables the protocol to take advantage of new
  375. algorithms. Choices are negotiated between client and server at the start
  376. of establishing a protocol session.</p>
  377.  
  378. <h3><a name="table4" id="table4">Table 4: Versions of the SSL protocol</a></h3>
  379.  
  380.     <table class="bordered">
  381.     
  382.     <tr><th>Version</th>
  383.         <th>Source</th>
  384.         <th>Description</th>
  385.         <th>Browser Support</th></tr>
  386.     <tr><td>SSL v2.0</td>
  387.         <td>Vendor Standard (from Netscape Corp.) [<a href="#SSL2">SSL2</a>]</td>
  388.         <td>First SSL protocol for which implementations exists</td>
  389.         <td>- NS Navigator 1.x/2.x<br />
  390.         - MS IE 3.x<br />
  391.         - Lynx/2.8+OpenSSL</td></tr>
  392.     <tr><td>SSL v3.0</td>
  393.         <td>Expired Internet Draft (from Netscape Corp.) [<a href="#SSL3">SSL3</a>]</td>
  394.         <td>Revisions to prevent specific security attacks, add non-RSA
  395.         ciphers, and support for certificate chains</td>
  396.         <td>- NS Navigator 2.x/3.x/4.x<br />
  397.         - MS IE 3.x/4.x<br />
  398.         - Lynx/2.8+OpenSSL</td></tr>
  399.     <tr><td>TLS v1.0</td>
  400.         <td>Proposed Internet Standard (from IETF) [<a href="#TLS1">TLS1</a>]</td>
  401.         <td>Revision of SSL 3.0 to update the MAC layer to HMAC, add block
  402.         padding for block ciphers, message order standardization and more
  403.         alert messages.</td>
  404.         <td>- Lynx/2.8+OpenSSL</td></tr>
  405.     </table>
  406.  
  407.  
  408. <p>There are a number of versions of the SSL protocol, as shown in 
  409. <a href="#table4">Table 4</a>. As noted there, one of the benefits in
  410. SSL 3.0 is that it adds support of certificate chain loading. This feature
  411. allows a server to pass a server certificate along with issuer certificates
  412. to the browser. Chain loading also permits the browser to validate the
  413. server certificate, even if Certificate Authority certificates are not
  414. installed for the intermediate issuers, since they are included in the
  415. certificate chain. SSL 3.0 is the basis for the Transport Layer Security 
  416. [<a href="#TLS1">TLS</a>] protocol standard, currently in development by
  417. the Internet Engineering Task Force (IETF).</p>
  418.  
  419. <h3><a name="session" id="session">Session Establishment</a></h3>
  420.  
  421.     <p>The SSL session is established by following a handshake sequence
  422.     between client and server, as shown in <a href="#figure1">Figure 1</a>. This sequence may vary, depending on whether the server
  423.     is configured to provide a server certificate or request a client
  424.     certificate. Though cases exist where additional handshake steps
  425.     are required for management of cipher information, this article
  426.     summarizes one common scenario: see the SSL specification for the full
  427.     range of possibilities.</p>
  428.  
  429.     <div class="note"><h3>Note</h3>
  430.     <p>Once an SSL session has been established it may be reused, thus
  431.     avoiding the performance penalty of repeating the many steps needed
  432.     to start a session. For this the server assigns each SSL session a
  433.     unique session identifier which is cached in the server and which the
  434.     client can use on forthcoming connections to reduce the handshake
  435.     (until the session identifer expires in the cache of the server).</p>
  436.     </div>
  437.  
  438.     <p class="figure">
  439.     <img src="ssl_intro_fig1.gif" alt="" width="423" height="327" /><br />
  440.     <a id="figure1" name="figure1"><dfn>Figure 1</dfn></a>: Simplified SSL
  441.     Handshake Sequence</p>
  442.  
  443.     <p>The elements of the handshake sequence, as used by the client and
  444.     server, are listed below:</p>
  445.  
  446.     <ol>
  447.     <li>Negotiate the Cipher Suite to be used during data transfer</li>
  448.     <li>Establish and share a session key between client and server</li>
  449.     <li>Optionally authenticate the server to the client</li>
  450.     <li>Optionally authenticate the client to the server</li>
  451.     </ol>
  452.  
  453.     <p>The first step, Cipher Suite Negotiation, allows the client and
  454.     server to choose a Cipher Suite supportable by both of them. The SSL3.0
  455.     protocol specification defines 31 Cipher Suites. A Cipher Suite is
  456.     defined by the following components:</p>
  457.  
  458.     <ul>
  459.     <li>Key Exchange Method</li>
  460.     <li>Cipher for Data Transfer</li>
  461.     <li>Message Digest for creating the Message Authentication Code (MAC)</li>
  462.     </ul>
  463.  
  464.     <p>These three elements are described in the sections that follow.</p>
  465.  
  466.  
  467. <h3><a name="keyexchange" id="keyexchange">Key Exchange Method</a></h3>
  468.  
  469.     <p>The key exchange method defines how the shared secret symmetric
  470.     cryptography key used for application data transfer will be agreed
  471.     upon by client and server. SSL 2.0 uses RSA key exchange only, while
  472.     SSL 3.0 supports a choice of key exchange algorithms including the
  473.     RSA key exchange when certificates are used, and Diffie-Hellman key
  474.     exchange for exchanging keys without certificates and without prior
  475.     communication between client and server.</p>
  476.  
  477.     <p>One variable in the choice of key exchange methods is digital
  478.     signatures -- whether or not to use them, and if so, what kind of
  479.     signatures to use. Signing with a private key provides assurance
  480.     against a man-in-the-middle-attack during the information exchange
  481.     used in generating the shared key [<a href="#AC96">AC96</a>, p516].</p>
  482.  
  483.  
  484. <h3><a name="ciphertransfer" id="ciphertransfer">Cipher for Data Transfer</a></h3>
  485.  
  486.     <p>SSL uses the conventional cryptography algorithm (symmetric
  487.     cryptography) described earlier for encrypting messages in a session.
  488.     There are nine choices, including the choice to perform no
  489.     encryption:</p>
  490.  
  491.     <ul>
  492.     <li>No encryption</li>
  493.     <li>Stream Ciphers
  494.         <ul>
  495.         <li>RC4 with 40-bit keys</li>
  496.         <li>RC4 with 128-bit keys</li>
  497.         </ul></li>
  498.     <li>CBC Block Ciphers
  499.         <ul><li>RC2 with 40 bit key</li>
  500.         <li>DES with 40 bit key</li>
  501.         <li>DES with 56 bit key</li>
  502.         <li>Triple-DES with 168 bit key</li>
  503.         <li>Idea (128 bit key)</li>
  504.         <li>Fortezza (96 bit key)</li>
  505.         </ul></li>
  506.     </ul>
  507.  
  508.     <p>Here "CBC" refers to Cipher Block Chaining, which means that a
  509.     portion of the previously encrypted cipher text is used in the
  510.     encryption of the current block. "DES" refers to the Data Encryption
  511.     Standard [<a href="#AC96">AC96</a>, ch12], which has a number of
  512.     variants (including DES40 and 3DES_EDE). "Idea" is one of the best
  513.     and cryptographically strongest available algorithms, and "RC2" is
  514.     a proprietary algorithm from RSA DSI [<a href="#AC96">AC96</a>,
  515.     ch13].</p>
  516.  
  517.  
  518. <h3><a name="digestfuntion" id="digestfuntion">Digest Function</a></h3>
  519.  
  520.     <p>The choice of digest function determines how a digest is created
  521.     from a record unit. SSL supports the following:</p>
  522.  
  523.     <ul>
  524.     <li>No digest (Null choice)</li>
  525.     <li>MD5, a 128-bit hash</li>
  526.     <li>Secure Hash Algorithm (SHA-1), a 160-bit hash</li>
  527.     </ul>
  528.  
  529.     <p>The message digest is used to create a Message Authentication Code
  530.     (MAC) which is encrypted with the message to provide integrity and to
  531.     prevent against replay attacks.</p>
  532.  
  533.  
  534. <h3><a name="handshake" id="handshake">Handshake Sequence Protocol</a></h3>
  535.  
  536.     <p>The handshake sequence uses three protocols:</p>
  537.  
  538.     <ul>
  539.     <li>The <dfn>SSL Handshake Protocol</dfn>
  540.     for performing the client and server SSL session establishment.</li>
  541.     <li>The <dfn>SSL Change Cipher Spec Protocol</dfn> for actually
  542.     establishing agreement on the Cipher Suite for the session.</li>
  543.     <li>The <dfn>SSL Alert Protocol</dfn> for conveying SSL error
  544.     messages between client and server.</li>
  545.     </ul>
  546.  
  547.     <p>These protocols, as well as application protocol data, are
  548.     encapsulated in the <dfn>SSL Record Protocol</dfn>, as shown in
  549.     <a href="#figure2">Figure 2</a>. An encapsulated protocol is
  550.     transferred as data by the lower layer protocol, which does not
  551.     examine the data. The encapsulated protocol has no knowledge of the
  552.     underlying protocol.</p>
  553.  
  554.     <p class="figure">
  555.     <img src="ssl_intro_fig2.gif" alt="" width="428" height="217" /><br />
  556.     <a id="figure2" name="figure2"><dfn>Figure 2</dfn></a>: SSL Protocol Stack
  557.     </p>
  558.  
  559.     <p>The encapsulation of SSL control protocols by the record protocol
  560.     means that if an active session is renegotiated the control protocols
  561.     will be transmitted securely. If there were no session before, then
  562.     the Null cipher suite is used, which means there is no encryption and
  563.     messages have no integrity digests until the session has been
  564.     established.</p>
  565.  
  566.  
  567. <h3><a name="datatransfer" id="datatransfer">Data Transfer</a></h3>
  568.  
  569.     <p>The SSL Record Protocol, shown in <a href="#figure3">Figure 3</a>,
  570.     is used to transfer application and SSL Control data between the
  571.     client and server, possibly fragmenting this data into smaller units,
  572.     or combining multiple higher level protocol data messages into single
  573.     units. It may compress, attach digest signatures, and encrypt these
  574.     units before transmitting them using the underlying reliable transport
  575.     protocol (Note: currently all major SSL implementations lack support
  576.     for compression).</p>
  577.  
  578.     <p class="figure">
  579.     <img src="ssl_intro_fig3.gif" alt="" width="423" height="323" /><br />
  580.     <a id="figure3" name="figure3"><dfn>Figure 3</dfn></a>: SSL Record Protocol
  581.     </p>
  582.  
  583.  
  584. <h3><a name="securehttp" id="securehttp">Securing HTTP Communication</a></h3>
  585.  
  586.     <p>One common use of SSL is to secure Web HTTP communication between
  587.     a browser and a webserver. This case does not preclude the use of
  588.     non-secured HTTP. The secure version is mainly plain HTTP over SSL
  589.     (named HTTPS), but with one major difference: it uses the URL scheme
  590.     <code>https</code> rather than <code>http</code> and a different
  591.     server port (by default 443). This mainly is what <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code> provides to you for the Apache webserver...</p>
  592.  
  593. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  594. <div class="section">
  595. <h2><a name="references" id="references">References</a></h2>
  596.  
  597. <dl>
  598. <dt><a id="AC96" name="AC96">[AC96]</a></dt>
  599. <dd>Bruce Schneier, <q>Applied Cryptography</q>, 2nd Edition, Wiley,
  600. 1996. See <a href="http://www.counterpane.com/">http://www.counterpane.com/</a> for various other materials by Bruce
  601. Schneier.</dd>
  602.  
  603. <dt><a id="X208" name="X208">[X208]</a></dt>
  604. <dd>ITU-T Recommendation X.208, <q>Specification of Abstract Syntax Notation
  605. One (ASN.1)</q>, 1988. See for instance <a href="http://www.itu.int/rec/recommendation.asp?type=items&lang=e&parent=T-REC-X.208-198811-I">http://www.itu.int/rec/recommendation.asp?type=items&lang=e&parent=T-REC-X.208-198811-I</a>.
  606. </dd>
  607.  
  608. <dt><a id="X509" name="X509">[X509]</a></dt>
  609. <dd>ITU-T Recommendation X.509, <q>The Directory - Authentication
  610. Framework</q>. See for instance <a href="http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&parent=T-REC-X.509">http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&parent=T-REC-X.509</a>.
  611. </dd>
  612.  
  613. <dt><a id="PKCS" name="PKCS">[PKCS]</a></dt>
  614. <dd><q>Public Key Cryptography Standards (PKCS)</q>, 
  615. RSA Laboratories Technical Notes, See <a href="http://www.rsasecurity.com/rsalabs/pkcs/">http://www.rsasecurity.com/rsalabs/pkcs/</a>.</dd>
  616.  
  617. <dt><a id="MIME" name="MIME">[MIME]</a></dt>
  618. <dd>N. Freed, N. Borenstein, <q>Multipurpose Internet Mail Extensions
  619. (MIME) Part One: Format of Internet Message Bodies</q>, RFC2045.
  620. See for instance <a href="http://ietf.org/rfc/rfc2045.txt">http://ietf.org/rfc/rfc2045.txt</a>.</dd>
  621.  
  622. <dt><a id="SSL2" name="SSL2">[SSL2]</a></dt>
  623. <dd>Kipp E.B. Hickman, <q>The SSL Protocol</q>, 1995. See <a href="http://www.netscape.com/eng/security/SSL_2.html">http://www.netscape.com/eng/security/SSL_2.html</a>.</dd>
  624.  
  625. <dt><a id="SSL3" name="SSL3">[SSL3]</a></dt>
  626. <dd>Alan O. Freier, Philip Karlton, Paul C. Kocher, <q>The SSL Protocol
  627. Version 3.0</q>, 1996. See <a href="http://www.netscape.com/eng/ssl3/draft302.txt">http://www.netscape.com/eng/ssl3/draft302.txt</a>.</dd>
  628.  
  629. <dt><a id="TLS1" name="TLS1">[TLS1]</a></dt>
  630. <dd>Tim Dierks, Christopher Allen, <q>The TLS Protocol Version 1.0</q>,
  631. 1999. See <a href="http://ietf.org/rfc/rfc2246.txt">http://ietf.org/rfc/rfc2246.txt</a>.</dd>
  632. </dl>
  633. </div></div>
  634. <div class="bottomlang">
  635. <p><span>Available Languages: </span><a href="../en/ssl/ssl_intro.html" title="English"> en </a></p>
  636. </div><div id="footer">
  637. <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
  638. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
  639. </body></html>